package com.haiqi.modules.map.web;

import com.github.pagehelper.PageInfo;
import com.haiqi.common.BaseController;
import com.haiqi.common.annotation.SafeAuthority;
import com.haiqi.common.bean.DataGridBean;
import com.haiqi.common.bean.PageBean;
import com.haiqi.common.persistence.entity.ShipTouchline;
import com.haiqi.common.utils.PageUtils;
import com.haiqi.modules.map.service.TouchLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by hythzx on 2016/6/29.
 */
@RestController
@RequestMapping("/manage/map/touchline")
@SafeAuthority(menuCode = "monitorLocation,companyMonitorLocation")
public class TouchLineController extends BaseController {

    @Autowired
    private TouchLineService touchLineService;

    @RequestMapping("/list")
    public DataGridBean<ShipTouchline> list(ShipTouchline shipTouchline,PageBean page){
        PageInfo<ShipTouchline> dataList = touchLineService.getDataList(shipTouchline, page);
        DataGridBean<ShipTouchline> shipTouchlineDataGridBean = new DataGridBean<>();
        PageUtils.convertToEasyuiList(dataList, shipTouchlineDataGridBean);
        return shipTouchlineDataGridBean;
    }
}
